home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////
- //
- // Routing.js
- //
- // Routing routine mapping for generic pages
- //
-
- // Delete a routing (This will cascade up to Root.html)
- function DeleteRouting( Dest, FrameObject )
- {
- return top._DeleteRouting( Dest, FrameObject );
- }
-
- // Add a routing (This will cascade up to Root.html)
- function AddRouting( Dest, FrameObject, Dependants )
- {
- return top._AddRouting( Dest, FrameObject, Dependants );
- }
-
- // Route a function call (This will cascade up to Root.html)
- function RouteCall( Dest, EvalCode )
- {
- return top._RouteCall( Dest, EvalCode );
- }
-
- // Set Queueing mode (This will cascade up to Root.html)
- function SetQueueMode( Dest, Mode, Recurse )
- {
- return top._SetQueueMode( Dest, Mode, Recurse );
- }
-
- // Execute some code (called from Root.html)
- function EvalCode(MyCode)
- {
- if( MyCode != "" )
- {
- return eval(MyCode);
- }
- }
-
- ////////////////////////////////////////////////////////////////
- //
- // Simplified mappings
- //
-
- // Roots
-
- function GetLanguageFolder()
- {
- // This is a hack for speed!
- return top._GetLanguageFolder();
- // Proper call should be:
- // return top._RouteCall( "Root", "_GetLanguageFolder();" );
- }
-
- function SetConsoleMode( Expert )
- {
- // This is a hack for speed!
- return top._SetConsoleMode( Expert );
- // Proper call should be:
- // return top._RouteCall( "Root", "_SetConsoleMode("+Expert+");" );
- }
-
- // Liquid Toolkit (through proxies)
-
- function LTKTriggerEvent(driver)
- {
- return top._RouteCall( "Liquid", "_LTKTriggerEvent('"+driver+"');" );
- }
-
- function LTKDoHelp()
- {
- return top._RouteCall( "Liquid", "_LTKTriggerEvent('CommandDispatcher,Active,20140');" );
- }
-
- function LTKConnectToWorkflow(wkf)
- {
- return top._RouteCall( "Liquid", "_LTKConnectToWorkflow('"+wkf+"');" );
- }
-
- function LTKDisconnectFromWorkflow(wkf)
- {
- return top._RouteCall( "Liquid", "_LTKDisconnectFromWorkflow('"+wkf+"');" );
- }
-
- function LTKGetContext( Ctx )
- {
- return top._RouteCall( "Liquid", "_LTKGetContext("+Ctx+");" );
- }
-
- function isMapi()
- {
- return top._RouteCall( "Liquid", "_isMapi();" );
- }
-
- function isPrinters()
- {
- return top._RouteCall( "Liquid", "_isPrinters();" );
- }
-
- function LTKGetKeyValue( KeyName, ValueName, Default )
- {
- return top._RouteCall( "Liquid", "_LTKGetKeyValue('"+KeyName+"','"+ValueName+"','"+Default+"');" );
- }
-
- function LTKGetIntKeyValue( KeyName, ValueName, Default )
- {
- return top._RouteCall( "Liquid", "_LTKGetIntKeyValue('"+KeyName+"','"+ValueName+"','"+Default+"');" );
- }
-
- function LTKSetKeyValue( KeyName, ValueName, Value )
- {
- return top._RouteCall( "Liquid", "_LTKSetKeyValue('"+KeyName+"','"+ValueName+"','"+Value+"');" );
- }
-
- function LTKSetIntKeyValue( KeyName, ValueName, Value )
- {
- return top._RouteCall( "Liquid", "_LTKSetIntKeyValue('"+KeyName+"','"+ValueName+"','"+Value+"');" );
- }
-
- // Logo
-
- // ActivityList
-
- function ALUpdateButton(Btn)
- {
- return top._RouteCall( "ActivityList", "_ALUpdateButton("+Btn+");" );
- }
-
- function ALClickButton(Btn)
- {
- return top._RouteCall( "ActivityList", "_ALClickButton("+Btn+");" );
- }
-
- function ALActivate(ID)
- {
- return top._RouteCall( "ActivityList", "_ALActivate("+ID+");" );
- }
-
-
- // ToolKits
-
- function TKUpdateButton(Btn)
- {
- return top._RouteCall( "ToolKits", "_TKUpdateButton("+Btn+");" );
- }
-
- function TKClickButton(Btn)
- {
- return top._RouteCall( "ToolKits", "_TKClickButton("+Btn+");" );
- }
-
- function TKSetMode( mode )
- {
- return top._RouteCall( "ToolKits", "_TKSetMode("+mode+");" );
- }
-
-
- // Tools
-
- function TUpdateButton()
- {
- return top._RouteCall( "Tools", "_TUpdateButton();" );
- }
-
- function TClickButton(Btn)
- {
- return top._RouteCall( "Tools", "_TClickButton("+Btn+");" );
- }
-
- function TClickButton2(Btn)
- {
- return top._RouteCall( "Tools", "_TClickButton2("+Btn+");" );
- }
-
- function TSetVisibility(Mask)
- {
- return top._RouteCall( "Tools", "_TSetVisibility("+Mask+");" );
- }
-
- // CommandBar
-
- function CUpdateButton(Btn)
- {
- return top._RouteCall( "CommandBar", "_CUpdateButton("+Btn+");" );
- }
-
- function CClickButton(Btn)
- {
- return top._RouteCall( "CommandBar", "_CClickButton("+Btn+");" );
- }
-
- // ShelfBar
-
- function SBUpdateButton(Btn)
- {
- return top._RouteCall( "ShelfBar", "_SBUpdateButton("+Btn+");" );
- }
-
- function SBClickButton(Btn)
- {
- return top._RouteCall( "ShelfBar", "_SBClickButton("+Btn+");" );
- }
-
- // WorkArea
-
- // Shelves
-
- function SSetShelfMode(Mode)
- {
- return top._RouteCall( "Shelves", "_SSetShelfMode("+Mode+");" );
- }
-
- function SUpdateShelves()
- {
- return top._RouteCall( "Shelves", "_SUpdateShelves();" );
- }
-
- // BuddyTools
-
- function BTSetVisibility(Mask)
- {
- return top._RouteCall( "BuddyTools", "_BTSetVisibility("+Mask+");" );
- }
-
- function BTSetPaintMode(mode)
- {
- return top._RouteCall( "BuddyTools", "_BTSetPaintMode("+mode+");" );
- }
-
- // P_RightPaneA
-
- function RPASetTarget(sNewTarget)
- {
- var sFullPath;
-
- sFullPath = ResolvePath( window.location.href, sNewTarget );
-
- // This is a hack for speed!
- return top._RPASetTarget(sFullPath);
- // Proper call should be:
- // return top._RouteCall( "P_RightPaneA", "_RPASetTarget('"+sFullPath+"');" );
- }
-
- // P_ToolKits
-
- function TKSetTarget(sNewTarget)
- {
- var sFullPath;
-
- sFullPath = ResolvePath( window.location.href, sNewTarget );
-
- // This is a hack for speed!
- return top._TKSetTarget(sFullPath);
- // Proper call should be:
- // return top._RouteCall( "P_ToolKits", "_TKSetTarget('"+sFullPath+"');" );
- }
-
- // P_Tools
-
- function TSetTarget(sNewTarget)
- {
- var sFullPath;
-
- sFullPath = ResolvePath( window.location.href, sNewTarget );
-
- return top._RouteCall( "P_Tools", "_TSetTarget('"+sFullPath+"');" );
- }
-
- // P_CommandBar (?)
-
- function CSetTarget(sNewTarget)
- {
- var sFullPath;
-
- sFullPath = ResolvePath( window.location.href, sNewTarget );
-
- return top._RouteCall( "P_CommandBar", "_CSetTarget('"+sFullPath+"');" );
- }
-
- // P_WorkArea
-
- function WSetTarget(sNewTarget,sWorkflow)
- {
- var sFullPath;
-
- sFullPath = ResolvePath( window.location.href, sNewTarget );
-
- return top._RouteCall( "P_WorkArea", "_WSetTarget('"+sFullPath+"','"+sWorkflow+"');" );
- }
-
- // P_BuddyTools
-
- function BTSetTarget(sNewTarget)
- {
- var sFullPath;
-
- sFullPath = ResolvePath( window.location.href, sNewTarget );
-
- return top._RouteCall( "P_BuddyTools", "_BTSetTarget('"+sFullPath+"');" );
- }
-
-
- ////////////////////////////////////////////////////////////////
- //
- // String manipulation (All slashes are expected forward!)
- //
-
- // Resolve a relative path to a base path
- function ResolvePath( sBasePath, sRelativePath )
- {
- var sNewBasePath;
- var sNewEndPath;
-
- var nLevelBack = 1; // Fix for last backslash
- var nCurrIdx = 0;
-
- var nTemp;
-
- // Start by removing the filename from sBasePath if present
- sNewBasePath = sBasePath.substring(0, sBasePath.lastIndexOf("/")+1 );
-
- // Count the number of levels we must go back
- while(1)
- {
- nTemp = sRelativePath.indexOf( "../", nCurrIdx );
-
- if( nTemp >= 0 )
- {
- nCurrIdx = nTemp + 3; // "../".length;
- nLevelBack += 1;
- }
- else
- {
- break;
- }
- }
-
- sNewEndPath = sRelativePath.substring( nCurrIdx, sRelativePath.length );
-
- // Go back
- while( nLevelBack > 0 )
- {
- nTemp = sBasePath.lastIndexOf("/", sNewBasePath.length-1);
- sNewBasePath = sNewBasePath.substring( 0, nTemp );
- nLevelBack -= 1;
- }
-
- // Return the value
- return sNewBasePath + "/" + sNewEndPath;
- }
-
-
- ////////////////////////////////////////////////////////////////
- //
- // Miscelaneous stuff
- //
-
- function SmartJump( fTarget, sNewTarget )
- {
- var sFullPath;
-
- sFullPath = ResolvePath( window.location.href, sNewTarget );
-
- if( fTarget.location.href != sFullPath )
- {
- fTarget.location.href = sFullPath;
- return 1;
- }
-
- return 0;
- }
-
- // Absolute path version
- function SmartJumpAbs( fTarget, sNewTarget )
- {
- if( fTarget.location.href != sNewTarget )
- {
- fTarget.location.href = sNewTarget;
- return 1;
- }
-
- return 0;
- }
-